package cn.itcast.Decoration;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Demo01_AddLine {
	public static void main(String[] args) throws IOException {
		String path="e:\\demo.java";
		AddLine(path);
	}
	public static void AddLine(String path) throws IOException{
		File file=new File(path);
		FileReader fr=new FileReader(file);
		BufferedReader br=new BufferedReader(fr);
		String line=null;
		int count=0;
		while((line=br.readLine()) != null){
			count++;
			System.out.println(count+": "+line);
		}
		br.close();
	}
}
